package messageclass

//保存消息类型和结构体和常量type

//接收/发送中转的信息
type RelayMsg struct {
	RecvId string
	Msg    string
}

//接收/发送中转的信息（组）
type GroupMsg struct {
	Group string
	Msg   string
}

//服务器收到加入/离开组返回的result的给客户端
type GroupResult struct {
	Group  string
	Status bool
}

type AckMsg struct {
	RecvId   string
	Received int
}

//用于尝试解释RPC的Msg是否带有RecvId参数
type RecvIdMsgTest struct {
	RecvId string
}

type Message struct {
	Id     string
	SendId string
	Type   string
	Msg    interface{} //这里需要使用 AckMsg,RelayMsg,GroupMsg,GroupResult
}

type JoinGroup struct {
	Group string
}

type LeftGroup struct {
	Group string
}

const MSG_IDNOTIFY = "notify_id"               //(string)sessionID定了不能变
const MSG_ACKNOTIFY = "notify_ack"             //(AckMsg)ACK信息无论是发送给服务器还是服务器发送给用户
const MSG_SEND = "send"                        //(RelayMsg,GroupMsg)用户发送给服务器的type
const MSG_RECEIVE = "receive"                  //(RelayMsg,GroupMsg)服务器接收到type为MSG_SEND的信息时转发给用户时的type则为MSG_RECEIVE
const MSG_SENDGROUP = "send_group"             //(GroupMsg)发送信息到组
const MSG_JOINGROUP = "joingroup"              //(JoinGroup)加入一个组
const MSG_JOINGROUPRESULT = "joingroup_result" //(GroupResult)加入一个组返回加入结果
const MSG_LEFTGROUP = "leftgroup"              //(LeftGroup)离开一个组
const MSG_LEFTGROUPRESULT = "leftgroup_result" //(GroupResult)离开一个组返回离开结果
